<template>
    <div id="app" :style="appStyle">
        <router-view></router-view>
    </div>
</template>

<script>
  export default {
    name: 'toolscontroller',
    data() {
      return {
        // 确保如果页面大小低于   1366 * 768  ，那么将页面宽度最低设置为1366 ，页面高度最低设置为768
        appStyle:{
          width: 0 + 'px',
          height: 0 + 'px'
        },
      }
    },
    activated() {

    },
    methods:{
    },
    mounted() {
      const cWidth = document.documentElement.clientWidth;
      const cHeight = document.documentElement.clientHeight;
      const mixWidth = this.$store.getters.mixWidth;
      const mixHeight = this.$store.getters.mixHeight;
      this.appStyle.width = (cWidth >= mixWidth ? cWidth : mixWidth) + 'px';
      this.appStyle.height = (cHeight >= mixHeight ? cHeight : mixHeight) + 'px';

      const that = this;

      window.onresize = function doReSize() {
        console.log(document.documentElement.clientWidth);
        console.log(mixWidth);
        that.appStyle.width = (document.documentElement.clientWidth >= mixWidth ? document.documentElement.clientWidth : mixWidth) + 'px';
        that.appStyle.height = (document.documentElement.clientHeight >= mixHeight ? document.documentElement.clientHeight : mixHeight) + 'px';
      };
    }
  }
</script>

<style>
</style>
